{include file='public/header' /}
<body style="overflow-x:hidden;">
	<div class="walletHeader1">
		<div class="imgboxes">
			<!-- <img src="__STATIC__/mobile/images/toux.png"> -->
		</div>
		<p class="walletNum commons">{$user.user_money}</p>
		<p class="walletTotal  commons">总资产折合{$user.user_moneys}RMB</p>
	</div>
	
	<div class="contents">
		<div class="submitBox" style="margin-top: .8rem;">
			<p class="regmobile">请填写转账信息</p>
			<div class="fgdiv" id="fgdiv1">
				<input type="text" id="user_money_addr" style="color: rgba(0,0,0,.5);" placeholder="请输入钱包地址">
			</div>
			<div class="fgdiv" id="fgdiv2">
				<input type="text" id="user_money" style="color: rgba(0,0,0,.5);" placeholder="请输入转账金额">
			</div>
		</div>
		<div class="logibtn"><span>确认转账</span></div>
	</div>
	<div class="footer">
		<ul>
			<li>
				<a href="{:url('index')}">
					<img src="__STATIC__/mobile/images/Walletsilhouette-hdpi.png">
					<p>钱包</p>
				</a>
			</li>
			<li>
				<a href="{:url('changemoney')}">
					<img src="__STATIC__/mobile/images/Exchangefill-hdpi.png">
					<p class="licolor">转账</p>
				</a>
			</li>
		</ul>
	</div>
	
	<script type="text/javascript">
		function init(){
			$('.tabchild').eq(0).show();
			$('.listop>li').eq(0).addClass('licolor');
		}
		init();
		$('.listop>li').click(function(){
			var index = $(this).index();
			$(this).addClass('licolor').siblings('li').removeClass('licolor');
			$('.tabchild').eq(index).show().siblings('.tabchild').hide();
		})
		//转账
		$(function(){
			$('.logibtn').click(function(){
				var user_money_addr = $('#user_money_addr').val();
				var user_money = $('#user_money').val();
				if (user_money_addr == '' || user_money == '') {
					layer.open({
					    content: '请填写钱包地址和金额'
					    ,skin: 'msg'
					    ,time: 2 //2秒后自动关闭
					  });
					return false;
				}
				$.ajax({
	                url:"{:url('changemoney')}",
	                type:'post',
	                cache:false,
	                dataType:'JSON',
	                timeout: 10000,
	                data:{
	                	user_money_addr:user_money_addr,
	                	user_money:user_money
	                },
	                success:function(data){
	                	if (data.code == 1) {
	                		layer.open({
							    content: data.msg
							    ,skin: 'msg'
							    ,time: 2 //2秒后自动关闭
							  });
				            window.location.href = data.url;
	                			
	                	}else{
	                		layer.open({
							    content: data.msg
							    ,skin: 'msg'
							    ,time: 2 //2秒后自动关闭
							  });
	                	}
	                    
	                    
	                }
	            })
			});
		})
		// fastclick.js组件的引用
		$(function() {
			FastClick.attach(document.body);
		})
	</script>

</body>
</html>